﻿@page "/locators"
@inject IStringLocalizer<Locators> Localizer

<h3>@Localizer["LocatorsTitle"]</h3>

<h4>@Localizer["LocatorsSubTitle"]</h4>

<DemoBlock Title="@Localizer["LocatorsNormalTitle"]"
           Introduction="@Localizer["LocatorsNormalIntro"]"
           Name="Normal"
           Demo="typeof(Demos.Locators.LocatorsNormal)">
    <p><b>@Localizer["LocatorsNormalDescription"]</b></p>
    <div class="mb-3">
        <p>@((MarkupString)Localizer["LocatorsNormalInjectIPLocator"].Value)</p>
        <Pre>[Inject]
[NotNull]
private IIPLocatorProvider? IPLocator { get; set; }
</Pre>
    </div>
    <Tips>
        <div>@((MarkupString)Localizer["LocatorsNormalTipsTilte"].Value)</div>
        <div><b>@Localizer["LocatorsNormalTips1"]</b></div>
        <div>@((MarkupString)Localizer["LocatorsNormalTips2"].Value)</div>
    </Tips>
    <Pre>Encoding.RegisterProvider(CodePagesEncodingProvider.Instance)</Pre>
    <p class="mt-3"><b>@Localizer["LocatorsNormalExtendDescription"]</b></p>
    <div>
        <p><b>@Localizer["LocatorsNormalExtend1"]</b></p>
        <Pre>private class CustomerLocator : IIPLocator
{
    public Task&lt;string&gt; Locate(IPLocatorOption option)
    {
        throw new NotImplementedException();
    }
}</Pre>
        <p><b>@Localizer["LocatorsNormalExtend2"]</b></p>
        <Pre>public void ConfigureServices(IServiceCollection services)
{
    services.AddBootstrapBlazor(locatorAction: option =>
    {
        option.LocatorFactory = provider => new CustomerLocator();
    });
}</Pre>
        <div>@((MarkupString)Localizer["LocatorsNormalCustomerLocator "].Value)</div>
    </div>
</DemoBlock>
